#ifndef PREVIEW_H
#define PREVIEW_H

#include <QWidget>
#include<QListWidget>
#include<QScrollArea>
#include<QLayout>
#include<Scene/mscene.h>
#include<QGraphicsView>
#include<Util/cstate.h>
#include<QLabel>
#include<QMenu>
#include<QAction>
#include<QDebug>
#include<QToolButton>
#include<QTabWidget>
#include<QTextEdit>
#include<UI/packagerui.h>
#include<QDockWidget>
#include<QString>
#include<QList>
#include<QDir>
#include<QStandardItemModel>
#include<QApplication>
#include<Util/PathUtil.h>
#include<Util/get_setInfo.h>
#include<UI/MethodsView.h>
#include<UI/StateInfoView.h>
#include<Util/CMethodsInfo.h>

class PreView : public QWidget
{
    Q_OBJECT
public:
    explicit PreView(QWidget *parent = 0);

    void initUI();

    void refreshMethodList();

    int addLeftTabWidget(QTabWidget *ParentTabWidget,QString LabelName,QString TabText,QString ObjectName,QWidget *AddedWidget);



    QListWidget *MdlListWidget;
    QTreeWidget *MethodsListWidget;
    QGridLayout *ViewArea;
    mScene *scene;
    PackagerUI *pUI;

signals:
     void addItem_clicked();
     void deleteItem_clicked();
     void clearItem_clicked();

     void toPack_clicked();
     void settings_clicked();
     void add_mdl_clicked();

     void LeftTabClicked(int);
     void mdlView_clicked();
     void methodsView_clicked();

public slots:
     void add_MdlListTab();

     void add_MethodListTab();

     void add_MdlView();

     void add_MethodView();

     void add_PackView();

private:
    QScrollArea *ViewScrollArea;
    QTabWidget *PreviewRight;
    QTabWidget *PreviewLeftListTab;
    MethodsView *mMethodView;
    QList<CMethodsInfo *> *mConversionMethods;
    QStringList internalMethodList;
    QString mDirPath;
    StateInfoView *mStateInfoView;


private slots:
    void showStateInfo(CState *);
    void on_customContextMenuRequested_(QPoint pos);

    void on_addItem_clicked();
    void on_deleteItem_clicked();
    void on_clearItem_clicked();

    void on_toPack_clicked();

    void on_settings_clicked();

    void on_add_mdl_clicked();

    void on_PreviewRight_close_tab_clicked(int index);

    void on_PreviewLeftListTab_close_tab_clicked(int index);

    void on_methodsList_item_clicked(QTreeWidgetItem*item, int ColumnIndex);




};

#endif // PREVIEW_H
